<template>
    <div style="font-size:50px; text-align:center;">
        AAAAAAA
        <router-link to="/b">toB</router-link>
        <router-link to="/c/1">toC</router-link>
    </div>
</template>

<script>
    export default {
        name: 'A',
        beforeRouteEnter (to, from, next) {
            console.log('组件还未被创建前执行beforeRouteEnter')
            next()
        },
        beforeRouteUpdate (to, from, next) {
            console.log('动态路由间切换,组件复用才会触发beforeRouteUpade')
            next()
        },
        beforeRouteLeave (to, from, next) {
            console.log('离开当前组件时触发beforeRouteLeave')
            next()
        }
    }
</script>
<style scoped>
</style>